<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>163-P215-作业-1</title>
</head>

<body>
    <!-- 1.世纪佳缘 用户名 显示隐藏内容 -->
    <input type="text" value="邮箱/ID/手机号" />
    <script>
        var ipt = document.querySelector('input');
        ipt.onfocus = function () {
            if (ipt.value === '邮箱/ID/手机号') {
                this.value = '';
            }
            this.style.outline = 'pink solid 2px';
        }
        ipt.onblur = function () {
            if (ipt.value === '') {
                this.value = '邮箱/ID/手机号';
            }
            this.style.outline = 'none';
        }
    </script>
</body>

</html>